import hashlib
import uuid
import time


def send_sms(phone):
    url = 'https://api.netease.im/sms/sendcode.action'
    headers = {}
    Nonce = str(uuid.uuid4()).replace('-', '')
    AppSecret = '4697c32048a1'
    CurTime = str(time.time())
    headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'
    headers['AppKey'] = 'a7c29a24fe50997474bd9c504b85f9db'
    headers['Nonce'] = Nonce
    headers['CurTime'] = CurTime
    CheckSum = hashlib.sha1((AppSecret + Nonce + CurTime).encode('utf-8')).hexdigest()
    headers['CheckSum'] = CheckSum

    import requests
    response = requests.post(url=url, data={'mobile': phone}, headers=headers)

    json_result = response.json()
    return json_result